package com.hui.xiao.xiaohui.view;

import android.app.Activity;
import android.os.Bundle;
import android.widget.CalendarView;
import android.widget.Toast;

import com.hui.xiao.xiaohui.R;

/**
 * Created by Administrator on 2016/5/21.
 */
public class CalendarViewTest extends Activity {
    CalendarView view;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.calendar_view);
        view = (CalendarView) findViewById(R.id.calendar_view);
        view.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {
            @Override
            public void onSelectedDayChange(CalendarView view, int year, int month, int dayOfMonth) {
                Toast.makeText(CalendarViewTest.this, "your birthday is " + year + "-" + month + "-" + dayOfMonth, Toast.LENGTH_SHORT).show();
            }
        });
    }
}
